from api import log
from config import HOST


class ApiRecharge:
    def __init__(self,session):
        self.session = session
        self.url_img_code = HOST + "/common/public/verifycode/{}"
        self.url_recharge = HOST + "/trust/trust/recharge"

    def api_img_code(self,random=123123):
        return self.session.get(url=self.url_img_code.format(random))

    def api_recharge(self):
        data = {
            "paymentType": "chinapnrTrust",
            "amount": 10000,
            "formStr": "reForm",
            "valicode": "8888"

        }
        return self.session.post(url=self.url_recharge, data=data)


